using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JVIT.TimeSheet.BLL
{
    [Serializable]
    public class Pause : TimedObject
    {
    }
    [Serializable]
    public class Pauses : List<Pause>
    {
        public TimeSpan TotalDuration { get { return new TimeSpan(this.Sum(p => p.Duration.Ticks)); } }
        public TimeSpan TotalDurationUnfinished { get { return new TimeSpan(this.Sum(p => p.DurationUnfinished.Ticks)); } }
        public Pause ActivePause { get { return this.FirstOrDefault(p => p.Started != null && p.Ended == null); } }
    }
}
